[Music]
Welcome to Working with JSON. After watching this video, you should be able
to: Parse JavaScript Object Notation (JSON) data
from a hypertext transfer protocol (HTTP) message. JSON is the standard format for application
programming interface (API) data exchange. It is the standard representation of native
JavaScript objects, and Node.js handles it easily. In this example, the object consists of attribute-value
pairs. The first attribute is "Company" and the value
is "IBM". The second attribute is "Country" and the
value is "USA". The third attribute is "Headquarters" and
the value is "Armonk, New York". To parse a JSON string to a JavaScript object, use method JSON.parse. Method JSON.stringify() converts a JavaScript
object to a JSON string. Now that you know what JSON is and two important
methods that you can use to parse a string into JSON and also convert JSON into a string.
Let us see an example of using a real endpoint that returns JSON. You can use JSON to find out how many astronauts
are in the International Space Station (ISS). You have found that the number of astronauts
is five. In this video, you learned that: Node.js handles JSON easily, and you can use two important methods to parse
a string into JSON and also convert JSON into a string.